package com.zhz.controller;

import com.zhz.service.FileUploadService;
import com.zhz.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 周恒哲
 * @date 2020/03/03
 **/
@RestController
@RequestMapping("/file")
public class FileUploadController {

    @Autowired
    private FileUploadService fileUploadService;

    /**
     * 图片上传
     */
    @RequestMapping("/upload")
    public String fileUpload(MultipartFile file){
        try {
            return this.fileUploadService.fileUpload(file);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;

    }


}
